package com.play.airfight.enemy.levelone;

import android.content.Context;
import android.graphics.Canvas;
import android.util.Log;

import com.play.airfight.R;
import com.play.airfight.enemy.enemy_contract.EnemyTypeData;
import com.play.airfight.enemy.enemy_contract.EnemyType;
import com.play.airfight.enemy.enemy_contract.BaseEnemy;


/**
 * 普通小怪
 */
public class SoliderLevelOne extends BaseEnemy {

    private static final String TAG = SoliderLevelOne.class.getSimpleName();

    public SoliderLevelOne(Context context, EnemyTypeData data) {
        super(context, data);
    }

    @Override
    public EnemyType getEnemyType() {
        return EnemyType.soldier_level_one;
    }

    @Override
    public void drawFrame(Canvas canvas) {
        super.drawFrame(canvas);

    }

    @Override
    public int setShape() {
        return R.drawable.ic_solider_one;
    }

    @Override
    public boolean isDead() {
        return isDead;
    }

    @Override
    public void execLogic() {
        // 执行每一帧的逻辑
        // 碰撞检测  回调返回结果
        detectCollsion(new IisCollided() {
            @Override
            public void afterCollsion() {
                Log.d(TAG, "execLogic:  命中");
            }
        });



        // 死亡检测
        if (isDead) {
            return;
        }
        // 下坠
        currentY += speed;


    }


}
